package tech.wenxu.curekaconsumer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Rest访问配置
 * @author zhaowenxu
 * @date 2020/4/11 13:24
 */
@Configuration
public class RestConfig {

    /**
     * 将restTemplate对象交给spring管理
     */
    @Bean
    // Ribbon负载均衡
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
